package cn.com.servyou.controller;

import cn.com.servyou.model.vo.CxRkmxVo;
import cn.com.servyou.model.vo.ReturnPageDataVo;
import cn.com.servyou.services.CxRkmxService;
import cn.com.servyou.utils.RestResultGenerator;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/***
 * 查询统计-入库明细 模块
 */
@RestController
@RequestMapping("/cx/rkmx")
public class CxRkmxController {

    @Resource
    CxRkmxService cxRkmxService;
    /**
     * 接收入库查询请求消息池
     * @param vo
     * @return
     */
    @RequestMapping(value = "queryRkmxList", method = {RequestMethod.POST, RequestMethod.GET})
    @ResponseBody
    public ReturnPageDataVo queryRkmxMessagePool(CxRkmxVo vo) {
        System.out.println("======");
        // 调用业务方法获取查询结果
        PageInfo pageInfo = cxRkmxService.queryRkmxList(vo);
        // 构建并返回统一结果数据类型
        return RestResultGenerator.genResult(pageInfo.getList(), (int) pageInfo.getTotal());
    }

}
